package registnet.records;

import java.util.HashMap;
import java.util.List;
import java.util.Vector;

public class PlanOfCoursework {

	Student student;
	HashMap<String, List<ICourse>> courses = new HashMap<String, List<ICourse>>();
	
	
	/**
	 * Default Constructor
	 * 
	 * @param student
	 */
	public PlanOfCoursework(Student student){
		this.student = student;
	}
	
	
	/**
	 * Gets the student who owns the plan of coursework
	 * 
	 * @return	The student who owns the plan of coursework
	 */
	public Student getStudent(){
		return this.student;
	}
	
	
	/**
	 * Sets the student who owns the plan of coursework
	 * 
	 * @param student - The student who owns the plan of coursework
	 */
	public void setStudent(Student student){
		this.student = student;
	}
	
	
	/**
	 * Gets the courses specified in the plan of coursework
	 * 
	 * @return	Mapping of a type and a list of curriculum courses
	 * 			Possible types:	GE(AH), GE(MST), GE(SSP), NSTP 1, NSTP 2, PE 2,
	 * 							MAJOR, ELECTIVE, CMSCCOURSE, COGNATE, OPTION, OPTION6,
	 * 							SEMINAR, SPECIALIZED, SUPPORTIVE, TECHNICAL, THESIS,
	 * 							PRACTICUM, ADDITIONAL
	 */
	public HashMap<String, List<ICourse>> getCourses(){
		return this.courses;
	}
	
	
	/**
	 * Adds the curriculum course to the plan of coursework
	 * 
	 * @param type - May be any of the following: 	GE(AH), GE(MST), GE(SSP), NSTP 1, NSTP 2, PE 2,
	 * 												MAJOR, ELECTIVE, CMSCCOURSE, COGNATE, OPTION, OPTION6,
	 * 												SEMINAR, SPECIALIZED, SUPPORTIVE, TECHNICAL, THESIS,
	 * 												PRACTICUM, ADDITIONAL
	 * @param c - The curriculum course to add
	 */
	public void addCourse(String type, ICourse cc){
		if (!courses.keySet().contains(type)){
			List<ICourse> courses = new Vector<ICourse>();
			courses.add(cc);
			this.courses.put(type, courses);
		}
		else{
			courses.get(type).add(cc);
		}
	}
}
